<template>
	<view class="uni-list">
		<view class="uni-list-cell" v-for="(item,index) in dataList" :key="index">
			<view class="leftInfo">
				<view class="top">
					提现
				</view>
				<view class="bottom">
					{{item.gmtCreate | getTime}}
				</view>
			</view>
			<view class="rightMoney">
				-￥{{item.money}}
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data() {
			return {
				dataList: [],
				pageNo:1
			}
		},
		onLoad() {
			this.getData()
		},
		onReachBottom() {
			this.getData()
		},
		methods:{
			getData(){
				let data = {
					accountId:uni.getStorageSync('buyerAccountId'),
					pageNo: this.pageNo,
					pageSize: 10,
				}
				this.$http.post('/api/v1.0/user/findUserWithdrawRecord',data,res=>{
					this.dataList = this.dataList.concat(res.data.data.list)
					this.pageNo++
				})
			}
		},
		filters: {
		  getTime (value) {
		    if (!value) return ''
		
			var now = new Date(value),
			y = now.getFullYear(),
			m = now.getMonth() + 1,
			d = now.getDate();
			return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d) + " " + now.toTimeString().substr(0, 8);
		   
		  }
		}
	}
</script>

<style lang="scss" scoped>
	.uni-list{
		background-color: #f2f2f2;
		min-height: 100vh;
		.uni-list-cell{
			padding: 30upx;
			height: 150upx;
			box-sizing: border-box;
			display: flex;
			justify-content: space-between;
			background-color: #fff;
			align-items: center;
			border-bottom: 1upx solid #F0F0F0;
			.leftInfo{
				.top{
					font-size: 32upx;
					color: #333;
				}
				.bottom{
					font-size: 24upx;
					color: #b3b3b3;
				}
			}
			.rightMoney{
				font-size: 36upx;
				color: #333;
				// font-weight: bold;
			}
		}
	}
</style>
